package com.cloudbroker.bcs.platform.ltb.middle.service.impl;

import com.cloudbroker.bcs.common.dao.base.DAOBase;
import com.cloudbroker.bcs.platform.ltb.middle.dao.credits.TaskProgressDAO;
import com.cloudbroker.bcs.platform.ltb.middle.entity.credits.TaskProgress;
import com.cloudbroker.bcs.platform.ltb.middle.service.TaskProgressService;
import com.cloudbroker.bcs.platform.ltb.middle.service.base.MycatServiceImplBase;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * Created by lili19289 on 2016/11/14.
 */
@Service
public class TaskProgressServiceImpl   extends MycatServiceImplBase implements TaskProgressService{

    @Resource
    private TaskProgressDAO taskProgressDAO;

    @Override
    protected DAOBase getDAO() {
        return taskProgressDAO;
    }

    public TaskProgress fetchByUser(@Param("user_id")long user_id, @Param("business_type")int business_type, @Param("company_id")String company_id){
        TaskProgress taskProgress = new TaskProgress();
        taskProgress.setUser_id(user_id);
        taskProgress.setBusiness_type(business_type);
        taskProgress.setCompany_id(company_id);
        return taskProgressDAO.fetchByUser(taskProgress);
    }

    public Integer findMaxMultiply(Map<String,Object> paramMap){
        return taskProgressDAO.findMaxMultiply(paramMap);
    }

}
